import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index.vue'
import ContentDefault from '@/views/ContentDafault/index.vue'
import ContentIndex from '@/views/home/index.vue'
import ContentUser from '@/views/ContentUser/index.vue'
import ContentPersonsInfo from '@/views/ContentPersonsInfo/index.vue'
import Commercial from '@/views/commercial/index.vue'
import Social from '@/views/social/index.vue'
import addMember from '@/views/addMember/index.vue'
import delMember from '@/views/delMember/index.vue'
import adjustableBase from '@/views/adjustableBase/index.vue'


import silingsi from '@/views/404.vue'

Vue.use(Router)
const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/home', // 首页
          name: 'home',
          component: ContentIndex
        },
        {
          path: '/ContentDefault', // * 未知
          name: 'ContentDefault',
          component: ContentDefault
        },
        {
          path: '/ContentUser',// 账户管理
          name: 'ContentUser',
          component: ContentUser
        },
        {
          path: '/ContentPersonsInfo', // 参保人
          name: 'ContentPersonsInfo',
          component: ContentPersonsInfo
        },
        {
          path: '/commercial',//商保理赔
          name: 'commercial' ,
          component: Commercial
        },
        {
          path: '/social', // 社保理赔
          name: 'social' ,
          component : Social
        },
        {
          path: '/addmember', // 增员
          name: 'addMember',
          component : addMember
        },
        {
          path: '/delmember', // 减员
          name: 'delMember',
          component : delMember
        },
        {
          path: '/adjustablebase', // 调基
          name: 'adjustableBase',
          component : adjustableBase
        },
        {
          path:'*',
          // name:'404',
          component: silingsi
        }
      ]
    }
    // {
    //   path:'*',
    //   redirect:'/404',
    //   component:wqewe
    // }
  ]
})
